package dodo.mindmap;

import java.awt.geom.Rectangle2D;
import java.awt.geom.Ellipse2D;

import processing.core.PApplet;

public class Circle extends Ellipse2D.Float implements Drawable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private static final int TEXT_MARGIN = 5;

	public Circle(float x, float y, float diameter) {
		super(x + diameter/2,y + diameter/2,diameter, diameter);
	}

	public void draw(PApplet parent) {
		//parent.ellipse(this.x, this.y, this.height, this.width);
		
		parent.ellipse((float) this.getCenterX(),(float) this.getCenterY(), this.height, this.width);
	}
	
	/*public void setFrame(float x, float y, float w, float h){
		super.setFrame(x, y, w, h);
	}*/

	public Rectangle2D getTextBoxBounds() {
		double dims = (this.height * (100 - TEXT_MARGIN)/100) * PApplet.sin(PApplet.radians((float) 45));
		
		Rectangle2D r = new Rectangle2D.Double(this.getCenterX(), this.getCenterY(), dims, dims);
		return r;
	}

}
